<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>发件箱</title>
    <!-- 公共CSS,JS文件 -->
    <#include "../../admin/common/header.ftl"/>
</head>
<body>
<div class="container-fluid">
    <!-- 左右侧导航 -->
    <div class="row">
        <!-- 右侧导航 -->
        <div class="col-xs-12">
            <div class="panel">
                <div class="panel-heading">
                    <ol class="breadcrumb" style="margin-bottom: 2px;">
                        <li>首页</li>
                        <li>系统管理</li>
                        <li>发件箱</li>
                        <div style="float: right; padding-bottom: 5px;"><a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="icon icon-refresh"></i></a></div>
                    </ol>
                </div>
                <!-- 添加mdal -->
                <div class="modal fade" id="addModal" <#--tabindex="-1"--> role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                    <div class="modal-dialog">
                        <div class="modal-content">
                            <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                                <h4 class="modal-title">发件箱</h4>
                            </div>
                            <div class="modal-body">
                                <form id="addForm" method="post" class="form-horizontal">
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">发送给</label>
                                        <div class="col-sm-5">
                                            <input type="text" class="form-control" name="users" />
                                        </div>
                                        <div class="col-sm-3">
                                            <a href="#" class="btn btn-info" onclick="optUsers()">选择收件人</a>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">类型</label>
                                        <div class="col-sm-8">
                                            <label class="radio-inline">
                                                <input type="radio" name="type" value="1"> 系统通知
                                            </label>
                                            <label class="radio-inline">
                                                <input type="radio" name="type" value="2"> 站内信
                                            </label>
                                            <label class="radio-inline">
                                                <input type="radio" name="type" value="3"> 用户通知
                                            </label>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">标题</label>
                                        <div class="col-sm-8">
                                            <input type="text" class="form-control" name="title" />
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">内容</label>
                                        <div class="col-sm-8">
                                            <textarea id="content" name="content" style="width:200px;height:50px;visibili.ty:hidden;"></textarea>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">级别</label>
                                        <div class="col-sm-8">
                                            <div class="col-sm-8">
                                                <label class="radio-inline">
                                                    <input type="radio" name="level" value="0"> 普通
                                                </label>
                                                <label class="radio-inline">
                                                    <input type="radio" name="level" value="1"> 高
                                                </label>
                                                <label class="radio-inline">
                                                    <input type="radio" name="level" value="-1"> 低
                                                </label>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-5 col-sm-offset-3">
                                            <button type="button" id="save" class="btn btn-primary">保存草稿</button>
                                            <button type="button" id="send" class="btn btn-success">发送</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
                <#--收件人列表modal-->
                <div class="modal fade" id="usersModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                    <div class="modal-dialog">
                        <div class="modal-content">
                            <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                                <h4 class="modal-title">收件人列表</h4>
                            </div>
                            <div class="modal-body">
                                <div id="users">
                                    <div id="datagridExample" class="datagrid"></div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- 修改modal -->
                <#--<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                    <div class="modal-dialog">
                        <div class="modal-content">
                            <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                                <h4 class="modal-title">修改角色</h4>
                            </div>
                            <div class="modal-body">
                                <!-- The form is placed inside the body of modal &ndash;&gt;
                                <form id="editForm" action="/admin/role/edit" method="post" class="form-horizontal">
                                    <input type="hidden" class="form-control" id="id" name="id" value="" />
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">角色名</label>
                                        <div class="col-sm-5">
                                            <input type="text" class="form-control" id="name" name="name" value="" />
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">角色编码</label>
                                        <div class="col-sm-5">
                                            <input type="text" class="form-control" id="code" name="code" value="" />
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-5 col-sm-offset-3">
                                            <button type="submit" class="btn btn-primary">修改</button>
                                            <button type="button" class="btn btn-primary" id="editResetBtn">取消</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>-->
                <#--内容-->
                <div class="panel-body">
                    <div class="row">
                        <!-- 搜索框 -->
                        <form action="/admin/msgSend/list" method="post">
                            <div class="col-xs-2">
                                <select name="status" data-placeholder="选择一个状态类型..." class="chosen-select form-control">
                                    <option value=""></option>
                                    <option value="1" <#if (((status)!'') == '1')>selected="selected"</#if> >已发送</option>
                                    <option value="0" <#if (((status)!'') == '0')>selected="selected"</#if> >草稿</option>
                                </select>
                            </div>
                            <div class="col-xs-3">
                                <input type="text" id="searchParam" name="searchParam" value="${searchParam!}" class="form-control" placeholder="标题/内容">
                            </div>
                            <div class="col-xs-2">
                                <input type="text" name="startDate" value="${startDate!}" class="form-control form-date" placeholder="开始时间" readonly="readonly">
                            </div>
                            <div class="col-xs-2">
                                <input type="text" name="endDate" value="${endDate!}" class="form-control form-date" placeholder="结束时间" readonly="readonly">
                            </div>
                            <div class="col-xs-2">
                                <button class="btn btn-primary" type="submit">搜索</button>
                            </div>
                        </form>
                    </div>
                    <div id="toolbar" class="toolbox btn-group" style="padding-top:10px; padding-bottom:10px;">
                        <div class="tools-group">
                            <#--<@shiro.hasPermission name="admin:role:add">
                                <button class="btn btn-primary" data-toggle="modal" data-target="#addModal"><i class="icon icon-plus"></i>添加</button>
                            </@shiro.hasPermission>-->
                                <button class="btn btn-primary" data-toggle="modal" data-target="#addModal"><i class="icon icon-plus"></i>新增</button>
                        </div>
                    </div>
                    <table class="table table-hover">
                        <thead>
                            <tr>
                                <th><input type="checkbox" onclick="checkBox('ids',this.checked)"/></th>
                                <th>编号</th>
                                <th>标题</th>
                                <th>级别</th>
                                <th>状态</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            <#if page.list??>
                                <#list page.list as msgSendDto>
                                    <tr>
                                        <th><input type="checkbox" class="checked_detect" value="${msgSendDto.id!?c }" name="ids"/></th>
                                        <th>${msgSendDto_index+1!}</th>
                                        <th>${msgSendDto.title!}</th>
                                        <th>
                                            <#if msgSendDto.level == 1>
                                                高
                                            <#elseif msgSendDto.level == 0>
                                                普通
                                            <#else>
                                                低
                                            </#if>
                                        </th>
                                        <th>
                                            <#if msgSendDto.status == '0'>
                                                草稿
                                            <#else>
                                                已发送
                                            </#if>
                                        </th>
                                        <th>
                                            <#--<@shiro.hasPermission name="admin:role:edit">-->
                                            <#if msgSendDto.status == '0'>
                                                <button class="btn btn-info" onclick="sendNode('${msgSendDto.id!?c }')">发送</button>
                                            </#if>
                                            <#--</@shiro.hasPermission>
                                            <#--<@shiro.hasPermission name="admin:role:edit">-->
                                            <button class="btn btn-success" onclick="editNode('${msgSendDto.id!?c }')">编辑</button>
                                            <#--</@shiro.hasPermission>
                                            <@shiro.hasPermission name="admin:role:delete">-->
                                            <button class="btn btn-danger" onclick="deleteNode('${msgSendDto.id!?c }')">删除</button>
                                            <#--</@shiro.hasPermission>-->
                                        </th>
                                    </tr>
                                </#list>
                            </#if>
                        </tbody>
                    </table>
                    <!-- 分页 start -->
                    <#include "../../admin/common/page.ftl"/>
                    <!-- 分页 end -->
                </div>
            </div>
        </div>
    </div>
<#include "../../admin/common/footer.ftl"/>
</div>
<#--导入msgSendList.js文件-->
<script src="/static/zui/js/msgSend/msgSendList.js"></script>
</body>
</html>